﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace B.R.RabbitRoot.Infrastructure.Migrations
{
    public partial class log : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "ButcherCompanies",
                columns: table => new
                {
                    EnterpriseID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SourceInfoId = table.Column<int>(type: "int", nullable: false),
                    CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    EstablishmentDate = table.Column<DateTime>(type: "datetime2", nullable: false),
                    CompanyProfile = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ButcherCompanies", x => x.EnterpriseID);
                });

            migrationBuilder.CreateTable(
                name: "Companyaddresses",
                columns: table => new
                {
                    companyaddressId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    EnterpriseID = table.Column<int>(type: "int", nullable: false),
                    Province = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    City = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    District = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Address = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Companyaddresses", x => x.companyaddressId);
                });

            migrationBuilder.CreateTable(
                name: "DeepProcessingTeamInfos",
                columns: table => new
                {
                    DeepProcessingTeamId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SourceInfoId = table.Column<int>(type: "int", nullable: false),
                    ProductionTeam = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    TeamLeader = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_DeepProcessingTeamInfos", x => x.DeepProcessingTeamId);
                });

            migrationBuilder.CreateTable(
                name: "FarmInfos",
                columns: table => new
                {
                    enterpriseID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SourceInfoId = table.Column<int>(type: "int", nullable: false),
                    FarmName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ResponsiblePerson = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    LivestockCount = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FarmInfos", x => x.enterpriseID);
                });

            migrationBuilder.CreateTable(
                name: "FarmingDetails",
                columns: table => new
                {
                    FarmingDetailsId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SourceInfoId = table.Column<int>(type: "int", nullable: false),
                    breed = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    source = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    feeding_days = table.Column<int>(type: "int", nullable: false),
                    feed_brand = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    caretaker = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    harvest_date = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_FarmingDetails", x => x.FarmingDetailsId);
                });

            migrationBuilder.CreateTable(
                name: "HealthCareInfos",
                columns: table => new
                {
                    HealthCareInfoId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    FarmingDetailsId = table.Column<int>(type: "int", nullable: false),
                    FeedingDays = table.Column<int>(type: "int", nullable: false),
                    HealthCareMethod = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    HealthCareProcedure = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    DeleteIs = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_HealthCareInfos", x => x.HealthCareInfoId);
                });

            migrationBuilder.CreateTable(
                name: "ImageTables",
                columns: table => new
                {
                    ImageID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SourceInfoId = table.Column<int>(type: "int", nullable: false),
                    PrimaryCategory = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SecondaryCategory = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ImageUrl = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ImageTables", x => x.ImageID);
                });

            migrationBuilder.CreateTable(
                name: "ProcessingEnterpriseInfos",
                columns: table => new
                {
                    CompanyID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SourceInfoId = table.Column<int>(type: "int", nullable: false),
                    CompanyName = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ProductionLicenseNumber = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ProcessingEnterpriseInfos", x => x.CompanyID);
                });

            migrationBuilder.CreateTable(
                name: "SlaughterInfos",
                columns: table => new
                {
                    SlaughterInfoId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SourceInfoId = table.Column<int>(type: "int", nullable: false),
                    Batch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    AverageWeightOnArrival = table.Column<int>(type: "int", nullable: false),
                    TimeOfArrival = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SlaughterTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SlaughterInfos", x => x.SlaughterInfoId);
                });

            migrationBuilder.CreateTable(
                name: "SourceInfos",
                columns: table => new
                {
                    SourceInfoId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SourceTitleImg = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Sourceproduction = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SourceexpirationTime = table.Column<int>(type: "int", nullable: false),
                    Sourcelicence = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SourceCreamFirm = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SourCecoverPicture = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Completeness = table.Column<int>(type: "int", nullable: false),
                    SourceCreamPerson = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    SourceCreamTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    SourceUpdatePerson = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DeleteIs = table.Column<bool>(type: "bit", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SourceInfos", x => x.SourceInfoId);
                });

            migrationBuilder.CreateTable(
                name: "SupplierInfos",
                columns: table => new
                {
                    SupplierId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    SourceInfoId = table.Column<int>(type: "int", nullable: false),
                    PrimaryType = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    ProductionBatch = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    Certificatepicture = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SupplierInfos", x => x.SupplierId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "ButcherCompanies");

            migrationBuilder.DropTable(
                name: "Companyaddresses");

            migrationBuilder.DropTable(
                name: "DeepProcessingTeamInfos");

            migrationBuilder.DropTable(
                name: "FarmInfos");

            migrationBuilder.DropTable(
                name: "FarmingDetails");

            migrationBuilder.DropTable(
                name: "HealthCareInfos");

            migrationBuilder.DropTable(
                name: "ImageTables");

            migrationBuilder.DropTable(
                name: "ProcessingEnterpriseInfos");

            migrationBuilder.DropTable(
                name: "SlaughterInfos");

            migrationBuilder.DropTable(
                name: "SourceInfos");

            migrationBuilder.DropTable(
                name: "SupplierInfos");
        }
    }
}
